#!/bin/sh
cd ../../
ant
echo ""
mv ./result/decaf.jar ./TestCases/S3/decaf.jar
cd ./TestCases/S3
for i in `ls *.decaf`;
do
echo  "${i%.*}.tac";
java -jar decaf.jar -l 2 $i > output/${i%.*}.tac
done
java -jar decaf.jar stack.decaf -l 2 -m Stack > output/stack.tac

echo ""
cd ./output
mv blackjack.tac blackjack.t
for i in `ls *.tac`;
do
echo  "${i%.*}.result";
java -jar tac.jar $i > ${i%.*}.result
mv ${i%.*}.tac ../tac/${i%.*}.tac
done

mv blackjack.t ../tac/blackjack.tac
cd ..
./diff.sh
